﻿package com.wandian.view.mediator
{
	import com.wandian.controller.CLZNoticeName;
	import com.wandian.controller.PrizeCommand;
	import com.wandian.data.GameData;
	import com.wandian.model.SwfDataProxy;
	import com.wandian.model.socket.net.Command;
	import com.wandian.model.vo.RoomVo;
	import com.wandian.util.CLZButton;
	import com.wandian.util.CLZButtonFour;
	import com.wandian.util.CLZLlistScrollPanel;
	import com.wandian.util.CLZLoadIcon;
	import com.wandian.util.CLZLoadingData;
	import com.wandian.util.CLZTabBar;
	import com.wandian.util.CLZTiming;
	import com.wandian.util.GlowFilterManage;
	import com.wandian.util.RadioRoom;
	import com.wandian.view.components.ui.AddBtn;
	import com.wandian.view.components.ui.RoomInfo;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.events.TextEvent;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;

	/**   
	* @author long
	* @QQ 108232706
	* @version 1.0   
	*/   
	public class PrizeMediator extends Mediator
	{
		private var _tabBar:CLZTabBar;
		private var _mcContent:Sprite;
		private const TYPE_SHARE:int=1;
		private const TYPE_INVITATION:int=2;
		private var _filter:GlowFilterManage;
		private var _global:GameData;
		public static const NAME:String="PrizeMediator";

		public function PrizeMediator(param1:Object=null)
		{
			this._filter=GlowFilterManage.getInstance();
			this._global=GameData.getInstance();
			super(NAME, param1);
			return;
		} 

		override public function onRegister():void
		{
			facade.registerCommand(CLZNoticeName.PRIZE_RANK_REWARD_REQ, PrizeCommand);
			facade.registerCommand(CLZNoticeName.PRIZE_ACC_REWARD_REQ, PrizeCommand);
			facade.registerCommand(CLZNoticeName.PRIZE_TOP_REWARD_REQ, PrizeCommand);
			facade.registerCommand(CLZNoticeName.PRIZE_LOGIN_REWARD_REQ, PrizeCommand);
			this._mcContent=new Sprite();
			this.mcPrize.addChild(this._mcContent);
			this._mcContent.x=16;
			this._mcContent.y=77;
			AddBtn.initBtn(this.mcPrize, CLZNoticeName.HIDE_PRIZE_PANEL, AddBtn.CLOSE_TWO, "", 4, 1);
			var _loc_1:Array=[[this.mcPrize.myPrize_btn, GameData.tip["MY_PRIZE"], true], [this.mcPrize.rankPrizel_btn, GameData.tip["RANK_PRIZE"], true], [this.mcPrize.invitationPrize_btn, GameData.tip["INVITATION_PRIZE"], true]];
			if (this._global.userInfo.userVo.gp != GameData.QZONE_SID)
			{
			}
			if (this._global.userInfo.userVo.gp == GameData.FRIEND_SID)
			{
				this.mcPrize.rankPrizel_btn.visible=true;
				this.mcPrize.invitationPrize_btn.visible=true;
			}
			else
			{
				this.mcPrize.rankPrizel_btn.visible=false;
				this.mcPrize.invitationPrize_btn.visible=false;
			}
			this._tabBar=new CLZTabBar(_loc_1);
			var _loc_2:int=0;
			while (_loc_2 < _loc_1.length)
			{

				_loc_1[_loc_2][0].addEventListener(Event.CHANGE, this.changeTabBarHandler);
				_loc_2=_loc_2 + 1;
			}
			this._tabBar.setClickIndex(this.mcPrize.myPrize_btn);
			return;
		} 

		private function changeTabBarHandler(event:Event):void
		{
			GameData.removeNumChildre(this._mcContent);
			CLZLoadingData.show(this._mcContent, 685, 410);
			switch (event.target.name)
			{
				case "myPrize_btn":
				{
					this.sendNotification(CLZNoticeName.PRIZE_MY_REWARD_RES);
					break;
				}
				case "rankPrizel_btn":
				{
					this.sendNotification(CLZNoticeName.PRIZE_RANK_REWARD_REQ, this.TYPE_SHARE);
					break;
				}
				case "invitationPrize_btn":
				{
					this.sendNotification(CLZNoticeName.PRIZE_RANK_REWARD_REQ, this.TYPE_INVITATION);
					break;
				}
				default:
				{
					break;
				}
			}
			return;
		} 

		override public function listNotificationInterests():Array
		{
			return [CLZNoticeName.HIDE_PRIZE_PANEL, CLZNoticeName.PRIZE_RANK_REWARD_RES, CLZNoticeName.PRIZE_MY_REWARD_RES, CLZNoticeName.PRIZE_ACC_REWARD_RES, CLZNoticeName.PRIZE_TOP_REWARD_RES];
		} 

		override public function handleNotification(param1:INotification):void
		{
			var _loc_2:Sprite=null;
			var _loc_3:Array=null;
			var _loc_4:int=0;
			var _loc_5:CLZLlistScrollPanel=null;
			switch (param1.getName())
			{
				case CLZNoticeName.HIDE_PRIZE_PANEL:
				{
					facade.removeCommand(CLZNoticeName.PRIZE_RANK_REWARD_REQ);
					facade.removeCommand(CLZNoticeName.PRIZE_ACC_REWARD_REQ);
					facade.removeCommand(CLZNoticeName.PRIZE_TOP_REWARD_REQ);
					facade.removeCommand(CLZNoticeName.PRIZE_LOGIN_REWARD_REQ);
					facade.removeMediator(PrizeMediator.NAME);
					Texas.I._mcWindosView.removeChildTo(this.mcPrize);
					viewComponent=null;
					break;
				}
				case CLZNoticeName.PRIZE_RANK_REWARD_RES:
				{
					CLZLoadingData.hide(this._mcContent);
					_loc_3=param1.getBody() as Array;
					_loc_4=_loc_3[4];
					if (_loc_4 == this.TYPE_SHARE)
					{
						_loc_2=GameData.getSprite("ShareRankPrize");
						_loc_2["tip_txt"].text=GameData.tip["PRIZE_SHARE_TOP_TIP"];
						_loc_2["rank_txt"].text=GameData.tip["PRIZE_RANK_ID"];
						_loc_2["name_txt"].text=GameData.tip["PRIZE_RANK_NAME"];
						_loc_2["num_txt"].text=GameData.tip["PRIZE_RANK_SHARE_NUM"];
						_loc_2["reward_txt"].text=GameData.tip["PRIZE_RANK_PRIZE"];
						_loc_2["share_txt"].text=GameData.tip["PRIZE_RANK_SHARE"];
						_loc_2["shareReward"].text=GameData.tip["PRIZE_SHARE_REWARD"];
						_loc_2["shareYou_txt"].text=GameData.tip["PRIZE_SHARE_YOU"];
						_loc_2["intro_txt"].htmlText=GameData.tip["PRIZE_SHARE_INTRO"];
						_loc_2["share10_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 10);
						_loc_2["share20_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 20);
						_loc_2["share50_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 50);
						_loc_2["share100_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 100);
						_loc_2["share200_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 200);
						_loc_2["share500_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 500);
						_loc_2["share1000_txt"].text=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_NUM"], "NUM", 1000);
					}
					else
					{
						_loc_2=GameData.getSprite("InvitationFriendPrize");
						_loc_2["tip_txt"].addEventListener(TextEvent.LINK, this.linkTxtHandler);
						_loc_2["tip_txt"].htmlText=GameData.tip["PRIZE_INVITATION_TOP_TIP"] + " <font size=\'14\' color=\'#ff0000\'>" + GameData.replaceStrTipHtml(GameData.tip["INVITATION_URL"]) + "</font>";
						_loc_2["rank_txt"].text=GameData.tip["PRIZE_RANK_ID"];
						_loc_2["name_txt"].text=GameData.tip["PRIZE_RANK_NAME"];
						_loc_2["num_txt"].text=GameData.tip["PRIZE_RANK_INVITATION_NUM"];
						_loc_2["reward_txt"].text=GameData.tip["PRIZE_RANK_PRIZE"];
						_loc_2["share_txt"].text=GameData.tip["PRIZE_RANK_SHARE"];
						_loc_2["invitationReward_txt"].text=GameData.tip["PRIZE_INVITATION_NAME"];
						_loc_2["invitationYou_txt"].text=GameData.tip["PRIZE_INVITATION_YOU"];
						_loc_2["intro_txt"].htmlText=GameData.tip["PRIZE_INVITATION_INTRO"];
						_loc_2["invitation10_txt"].text="";
						_loc_2["invitation20_txt"].text="";
						_loc_2["invitation50_txt"].text="";
						_loc_2["invitation100_txt"].text="";
						_loc_2["invitation200_txt"].text="";
						_loc_2["invitation500_txt"].text="";
						_loc_2["invitation1000_txt"].text="";
					}
					this.rankPrizePanel(_loc_2, _loc_3);
					break;
				}
				case CLZNoticeName.PRIZE_MY_REWARD_RES:
				{
					CLZLoadingData.hide(this._mcContent);
					_loc_2=GameData.getSprite("MyPrize");
					this.showMyPrize(_loc_2, GameData._arrMyPrize);
					break;
				}
				case CLZNoticeName.PRIZE_TOP_REWARD_RES:
				{
					_loc_3=param1.getBody() as Array;
					this._global.userInfo.money=_loc_3[0];
					this.sendNotification(CLZNoticeName.SHOW_MOVE_TIP, {tip: GameData.replaceStrValue(GameData.tip["PRIZE_DRAW_SUCC"], "NUM", _loc_3[1])});
					break;
				}
				case CLZNoticeName.PRIZE_ACC_REWARD_RES:
				{
					_loc_3=param1.getBody() as Array;
					this._global.userInfo.money=_loc_3[0];
					this.sendNotification(CLZNoticeName.SHOW_MOVE_TIP, {tip: GameData.replaceStrValue(GameData.tip["PRIZE_DRAW_SUCC"], "NUM", _loc_3[1])});
					break;
				}
				default:
				{
					break;
				}
			}
			if (_loc_2 != null)
			{
				GameData.removeNumChildre(this._mcContent);
				_loc_5=new CLZLlistScrollPanel(1, 720, 610, 0, 0, 410, 685);
				_loc_5.setMc(_loc_2, 0, 1);
				this._mcContent.addChild(_loc_5);
				_loc_5.x=10;
				_loc_5.y=10;
			}
			return;
		} 

		private function linkTxtHandler(event:TextEvent):void
		{
//			JSFUN.shareInvitationFunc();
			return;
		} 

		private function showMyPrize(param1:Sprite, param2:Array):void
		{
			var onDayPrizeHandler:Function;
			var vipNum:int;
			var onVIPPrizeHandler:Function;
			var onWinNumPrizeHandler:Function;
			var winRank:int;
			var winNum:int;
			var isDraw:int;
			var panel:*=param1;
			var arr:*=param2;
			onDayPrizeHandler=function(event:MouseEvent):void
			{
				var _loc_2:*=event.target as MovieClip;
				_loc_2.mouseEnabled=false;
				CLZButton.updateMcText(_loc_2, GameData.tip["PRIZE_DRAW_YES"]);
				_loc_2.filters=_filter.getGrayscale();
				if (_loc_2.hasEventListener(MouseEvent.CLICK))
				{
					_loc_2.removeEventListener(MouseEvent.CLICK, onDayPrizeHandler);
				}
				facade.sendNotification(CLZNoticeName.PRIZE_LOGIN_REWARD_REQ, arr[0][3]);
				return;
			} 
			;
			onVIPPrizeHandler=function(event:MouseEvent):void
			{
				var _loc_2:SwfDataProxy=null;
				var _loc_3:MovieClip=null;
				if (vipNum == 0)
				{
					_loc_2=facade.retrieveProxy(SwfDataProxy.NAME) as SwfDataProxy;
					_loc_2.singleLoadSWF("vip", CLZNoticeName.SHOW_VIP_PRIVILEGE);
					facade.sendNotification(CLZNoticeName.HIDE_PRIZE_PANEL);
				}
				else
				{
					_loc_3=event.target as MovieClip;
					CLZButton.setButton(_loc_3, GameData.tip["PRIZE_DRAW_YES"]);
					CLZButton.enabled(panel["vipPrize_btn"], false, 1);
					if (_loc_3.hasEventListener(MouseEvent.CLICK))
					{
						_loc_3.removeEventListener(MouseEvent.CLICK, onVIPPrizeHandler);
					}
					facade.sendNotification(CLZNoticeName.PRIZE_VIP_REWARD_REQ, arr[0][0]);
				}
				return;
			} 
			;
			onWinNumPrizeHandler=function(event:MouseEvent):void
			{
				var _loc_2:*=event.target as MovieClip;
				_loc_2.mouseEnabled=false;
				_loc_2.filters=_filter.getGrayscale();
				CLZButton.setButton(_loc_2, GameData.tip["PRIZE_DRAW_YES"]);
				if (_loc_2.hasEventListener(MouseEvent.CLICK))
				{
					_loc_2.removeEventListener(MouseEvent.CLICK, onVIPPrizeHandler);
				}
				facade.sendNotification(CLZNoticeName.PRIZE_WINNUM_REWARD_REQ, arr[2][0]);
				return;
			} 
			;
			CLZLoadIcon.addIcon(panel["icon1"], GameData.flashUrl + "assets/img/prize/prize-login.png", 190, 90);
			CLZLoadIcon.addIcon(panel["icon2"], GameData.flashUrl + "assets/img/prize/prize-vip.png", 190, 90);
			CLZLoadIcon.addIcon(panel["icon3"], GameData.flashUrl + "assets/img/prize/prize-win.png", 190, 90);
			var num:*=int(arr[0][3]) > 3 ? (3) : (int(arr[0][3]));
			panel["txtDayNum_txt"].htmlText=GameData.replaceStrValue(GameData.tip["TXT_DAY_NUM"], "NUM", arr[0][3]);
			panel["drawGold_txt"].htmlText=GameData.replaceStrValue(GameData.replaceStrValue(GameData.tip["DRAW_GOLD_TXT"], "NUM", arr[0][3]), "SUM_NUM", num * 1000);
			panel["introLogin_txt"].htmlText=GameData.replaceStrTipHtml(GameData.tip["INTRO_LOGIN_TXT"]);
			if (int(arr[0][2]))
			{
				CLZButton.setButton(panel["dayPrize_btn"], GameData.tip["PRIZE_DRAW_YES"]);
				panel["dayPrize_btn"].mouseEnabled=false;
				panel["dayPrize_btn"].filters=this._filter.getGrayscale();
			}
			else
			{
				panel["dayPrize_btn"].mouseEnabled=true;
				panel["dayPrize_btn"].filters=null;
				CLZButton.setButton(panel["dayPrize_btn"], GameData.tip["PRIZE_DRAW_NO"]);
				panel["dayPrize_btn"].addEventListener(MouseEvent.CLICK, onDayPrizeHandler);
			}
			vipNum;
			if (arr[1].length != 0)
			{
			}
			if (int(arr[1][0]) == 0)
			{
				panel["vipGold_txt"].htmlText=GameData.tip["VIP_NO"];
				CLZButton.setButton(panel["vipPrize_btn"], GameData.tip["MORE_VIP"]);
				panel["vipPrize_btn"].mouseEnabled=true;
				panel["vipPrize_btn"].filters=null;
				panel["vipPrize_btn"].addEventListener(MouseEvent.CLICK, onVIPPrizeHandler);
			}
			else
			{
				vipNum=arr[1][0];
				panel["vipGold_txt"].htmlText=GameData.replaceStrValue(GameData.replaceStrValue(GameData.tip["VIP_GOLD_TXT"], "VIP", arr[1][0]), "NUM", arr[1][1]);
				if (int(arr[1][2]))
				{
					CLZButton.setButton(panel["vipPrize_btn"], GameData.tip["PRIZE_DRAW_YES"]);
					CLZButton.enabled(panel["vipPrize_btn"], false, 1);
				}
				else
				{
					panel["vipPrize_btn"].mouseEnabled=true;
					panel["vipPrize_btn"].filters=null;
					CLZButton.setButton(panel["vipPrize_btn"], GameData.tip["PRIZE_DRAW_NO"]);
					panel["vipPrize_btn"].addEventListener(MouseEvent.CLICK, onVIPPrizeHandler);
				}
			}
			if (arr[2].length != 0)
			{
				winRank=arr[2][0];
				winNum=arr[2][1];
				isDraw=arr[2][2];
				panel["winGold_txt"].htmlText=GameData.replaceStrValue(GameData.replaceStrValue(GameData.tip["WIN_GOLD_RANK_REWARD_OK"], "NUM", winRank), "VALUE", winNum);
				if (isDraw)
				{
					CLZButton.setButton(panel["winPrize_btn"], GameData.tip["PRIZE_DRAW_YES"]);
					panel["winPrize_btn"].mouseEnabled=false;
					panel["winPrize_btn"].filters=this._filter.getGrayscale();
				}
				else
				{
					CLZButton.setButton(panel["winPrize_btn"], GameData.tip["PRIZE_DRAW_NO"]);
					panel["winPrize_btn"].mouseEnabled=true;
					panel["winPrize_btn"].filters=null;
					panel["winPrize_btn"].addEventListener(MouseEvent.CLICK, onWinNumPrizeHandler);
				}
			}
			else
			{
				panel["winGold_txt"].htmlText=GameData.tip["WIN_GOLD_RANK_REWARD_NO"];
				CLZButton.setButton(panel["winPrize_btn"], GameData.tip["CONDITION_ERR"]);
				panel["winPrize_btn"].mouseEnabled=false;
				panel["winPrize_btn"].filters=this._filter.getGrayscale();
			}
			return;
		} 

		private function rankPrizePanel(param1:Sprite, param2:Array):void
		{
			var type:int;
			var onShareHandler:Function;
			var rankNum:int;
			var onDrawRewardHandler:Function;
			var sumNum:int;
			var n:String;
			var onNumDrawHandler:Function;
			var nDraw:int;
			var panel:*=param1;
			var arrData:*=param2;
			onShareHandler=function(event:MouseEvent):void
			{
				var _loc_2:*=event.target as MovieClip;
//				JSFUN.shareRankFunc(_loc_2.userid);
				return;
			} 
			;
			onDrawRewardHandler=function(event:MouseEvent):void
			{
				panel["rankReward_btn"].removeEventListener(MouseEvent.CLICK, onNumDrawHandler);
				CLZButton.updateMcText(panel["rankReward_btn"], GameData.tip["PRIZE_DRAW_YES"]);
				CLZButton.enabled(panel["rankReward_btn"], false, 1);
				facade.sendNotification(CLZNoticeName.PRIZE_TOP_REWARD_REQ, [type, rankNum]);
				return;
			} 
			;
			var checkBtnIsDraw:*=function(param1:MovieClip, param2:int, param3:int):void
			{
				param1.mouseChildren=false;
				if (param2)
				{
					if (type == this.TYPE_INVITATION)
					{
						param1.visible=false;
						return;
					}
					CLZButton.updateMcText(param1, GameData.tip["PRIZE_DRAW_YES"]);
					param1.mouseEnabled=false;
					param1.filters=_filter.getGrayscale();
				}
				else
				{
					if (type == 2)
					{
						CLZButton.updateMcText(param1, GameData.tip["PRIZE_DRAW"] + _global.counstK(param3 * 10000));
						param1.visible=false;
						return;
					}
					CLZButton.updateMcText(param1, GameData.tip["PRIZE_DRAW"] + _global.counstK(param3 * 1000));
					if (sumNum < param3)
					{
						trace("false");
						param1.mouseEnabled=false;
						param1.filters=_filter.getGrayscale();
					}
					else
					{
						trace("true");
						param1.mouseEnabled=true;
						param1.filters=null;
						param1.num=param3;
						param1.addEventListener(MouseEvent.CLICK, onNumDrawHandler);
					}
				}
				return;
			} 
			;
			onNumDrawHandler=function(event:MouseEvent):void
			{
				var _loc_2:*=event.target as MovieClip;
				_loc_2.removeEventListener(MouseEvent.CLICK, onNumDrawHandler);
				CLZButton.updateMcText(_loc_2, GameData.tip["PRIZE_DRAW_YES"]);
				_loc_2.mouseEnabled=false;
				_loc_2.filters=_filter.getGrayscale();
				facade.sendNotification(CLZNoticeName.PRIZE_ACC_REWARD_REQ, [type, _loc_2.num]);
				return;
			} 
			;
			var arrInfoMc:Array;
			type=arrData[4];
			var len:*=arrData[0].length;
			var i:int;
			while (i < arrInfoMc.length)
			{

				if (i >= len)
				{
					arrInfoMc[i].visible=false;
				}
				else
				{
					arrInfoMc[i].visible=true;
					trace(arrData[0]);
					arrInfoMc[i].rank_txt.text=((i + 1)).toString();
					arrInfoMc[i].name_txt.text=arrData[0][i][1].toString();
					arrInfoMc[i].num_txt.text=arrData[0][i][2].toString();
					if (type == 2)
					{
						arrInfoMc[i].gold_txt.text=100000 - i * 10000 + " " + GameData.tip["GOLD"];
					}
					else
					{
						arrInfoMc[i].gold_txt.text=10000 - i * 1000 + " " + GameData.tip["GOLD"];
					}
					arrInfoMc[i].share_btn.visible=false;
					if (this._global.userInfo.userVo.userid == arrData[0][i][0])
					{
						CLZButton.setButton(arrInfoMc[i].share_btn, GameData.tip["SHOW"]);
					}
					else
					{
						CLZButton.setButton(arrInfoMc[i].share_btn, GameData.tip["SHARE_TO_OTHER"]);
					}
					arrInfoMc[i].share_btn.userid=arrData[0][i][0];
					arrInfoMc[i].share_btn.addEventListener(MouseEvent.CLICK, onShareHandler);
				}
				i=(i + 1);
			}
			rankNum=arrData[2];
			var isDrawPrize:*=arrData[1];
			if (rankNum > 10)
			{
				panel["rankTip_txt"].htmlText=GameData.replaceStrValue(GameData.tip["PRIZE_RANK_TIP_NO"], "NUM", rankNum);
				panel["rankReward_btn"].visible=false;
			}
			else if (rankNum == 0)
			{
				panel["rankTip_txt"].text="";
				panel["rankReward_btn"].visible=false;
			}
			else
			{
				panel["rankTip_txt"].htmlText=GameData.replaceStrValue(GameData.tip["PRIZE_RANK_TIP_YES"], "NUM", rankNum);
				panel["rankReward_btn"].visible=true;
				if (isDrawPrize)
				{
					CLZButton.setButton(panel["rankReward_btn"], GameData.tip["PRIZE_DRAW_YES"]);
					CLZButton.enabled(panel["rankReward_btn"], false, 1);
				}
				else
				{
					CLZButton.setButton(panel["rankReward_btn"], GameData.tip["PRIZE_DRAW_NO"]);
					CLZButton.enabled(panel["rankReward_btn"], true, 1);
					panel["rankReward_btn"].addEventListener(MouseEvent.CLICK, onDrawRewardHandler);
				}
			}
			CLZButton.setButton(panel["reward10_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward20_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward50_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward100_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward200_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward500_btn"], GameData.tip["PRIZE_DRAW"]);
			CLZButton.setButton(panel["reward1000_btn"], GameData.tip["PRIZE_DRAW"]);
			var objData:*=arrData[3];
			sumNum=objData["2"];
			var _loc_4:int=0;
			var _loc_5:*=objData;
			while (_loc_5 in _loc_4)
			{

				n=_loc_5[_loc_4];
				nDraw=objData[n];
				switch (n)
				{
					case "0":
					{
						break;
					}
					case "1":
					{
						if (type == this.TYPE_INVITATION)
						{
							panel["toDayShare_txt"].htmlText=GameData.replaceStrValue(GameData.tip["PRIZE_INVITATION_TODAY_NUM"], "NUM", nDraw);
						}
						else
						{
							panel["toDayShare_txt"].htmlText=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_TODAY_NUM"], "NUM", nDraw);
						}
						break;
					}
					case "2":
					{
						if (type == this.TYPE_INVITATION)
						{
							panel["sumShare_txt"].htmlText="";
						}
						else
						{
							panel["sumShare_txt"].htmlText=GameData.replaceStrValue(GameData.tip["PRIZE_SHARE_SUM_NUM"], "NUM", nDraw);
						}
						break;
					}
					case "10":
					case "20":
					case "50":
					case "100":
					case "200":
					case "500":
					case "1000":
					{
						checkBtnIsDraw(panel["reward" + n + "_btn"], nDraw, n);
						break;
					}
					default:
					{
						break;
					}
				}
			}
			return;
		} 

		private function get mcPrize():MovieClip
		{
			return viewComponent as MovieClip;
		} 

	}
}
